<template>
  <view class="contents">
    <u-toast ref="uToast" />
    <view class="relebox" v-show="showList.length>0">
      <view class="rel" :style="showList.length>3?'width:33%':'width:50%'" v-for="(it,ind) in showList" :key='ind' @click="goNext(it.url)" >
        <i-icon :icon="it.icon" type="multiple" size="120rpx"></i-icon>
        <view class="rename">
          {{it.name}}
        </view>
      </view>
      
    </view>
  </view>
</template>

<script>
  export default {
    props: ['fabushow'],
    name: "dly",
    data() {
      return {
        fabushows: false,
        perminous: '',
				showList:[],//显示数量
				list:[{name:'发布寻车',icon:'iconfabu-fabuxunchenew',url:'/pages_findCar/releaseForCar/releaseForCar?type=1',qx:['CarStore']},
				{name:'发布车源',icon:'iconfabucheyuannew',url:'/pages_carSource/releaseOptions/releaseOptions',qx:['CarStore','Factory']},
				{name:'发布配件询价',icon:'iconfabupeijianxunjianew',url:'/pages_findAccessory/selectCarModel/selectCarModel',qx:['CarStore','BeautyStore','RepairStore']},
				{name:'上架车品',icon:'iconshangjiameihubaojingpinnew',url:'/pages_carGoods/selectTheCategory/selectTheCategory',qx:['CarStore','BeautyStore','RepairStore']},
				{name:'发起担保交易',icon:'iconfaqidanbaojiaoyinew',url:'/pages_order/securedTransactions/securedTransactions?page=index',qx:['CarStore','Factory']},
				]
      };
    },
    created() {
      this.perminous = this.$store.state.user.userInfo.permious
			this.returnAuthority()
    },
    methods: {
			goNext(url){
				uni.navigateTo({
				    url:url
				  })
			},
			// 根据权限显示
      returnAuthority(){
				let newArr=[]
				this.list.forEach((it,index)=>{
				if(it.qx.includes(this.perminous, 0)){
					newArr.push(it)
				}
				})
				this.showList=newArr
		    console.log(newArr)
			}
    }
  }
</script>

<style>
  .contents {}

  .relebox {
    width: 730rpx;
    height: 440rpx;
  }

  .rel {
    float: left;
    width: 33.3%;
    height: 250rpx;
    transition: all 0.8s;
		text-align: center;
  }

  .relmobile {
    float: left;
    width: 33.3%;
    height: 250rpx;
    position: absolute;
    top: 1080rpx;
    transition: all 0.8s;
  }

  .reimg {}

  .rename {
    font-size: 28rpx;
    font-family: PingFang SC;
    font-weight: 500;
    color: #666666;
    margin-top: 10rpx;
    margin-bottom: 100rpx;
  }

  .tuichu {
    display: flex;
    justify-content: center;
    width: 750rpx;
  }

  .tuicimg {
    width: 62rpx;
    height: 62rpx;
  }
</style>
